package com.retailcloud.gateway.utils;

import com.retailcloud.gateway.constant.LoginTypeEnum;

import java.util.EnumSet;

/**
 * @author wudi
 * @date 2024/11/6
 * @comment
 */
public class EnumValidationUtils {
    public static boolean isValueInEnum(String value, Class<LoginTypeEnum> enumClass) {
        EnumSet<LoginTypeEnum> enumSet = EnumSet.allOf(enumClass);
        for (LoginTypeEnum status : enumSet) {
            if (status.name().equals(value)) {
                return true;
            }
        }
        return false;
    }
}
